package com.yj.springbootsecuritydemo01.rest;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

@RestController
public class HelloController{


        @GetMapping("hello")
        public String hello(){
            return "{'msg':'hi'}";
        }

        @GetMapping("me")
        private String showMe(Principal principal){
            return String.format("当前登录的用户是：[%s]",principal.getName());
        }

}
